<!--  -->
<template>
    <div v-show="isShow">
        <el-dialog title="编辑" :visible.sync="editVisible" width="30%">
            <el-form ref="form" :model="form" label-width="70px">
                <el-form-item label="用户名">
                    <el-input v-model="form.name"></el-input>
                </el-form-item>
                <el-form-item label="地址">
                    <el-input v-model="form.address"></el-input>
                </el-form-item>
            </el-form>
            <span slot="footer" class="dialog-footer">
                <el-button @click="editVisible = false">取 消</el-button>
                <el-button type="primary" @click="saveEdit">确 定</el-button>
            </span>
           
        </el-dialog>
         {{aNum}}
    </div>
</template>

<script>
import appMain from "../../../utils/app_main.js";

export default {
    
    props: {
        isShow: false
    },
    data () {
        return {
            showDialog: false,
            editVisible: false,
            form:{}
        }
    },
    methods:  {
        close () {
            this.$emit('close', {
                showDialog: false
            })
        },
        saveEdit () {
            this.$emit('edit', {name: 'avcc', showDialog: false})
        },
    },
    watch: {
        isShow: function (newVal, oldVal) {
            console.log(newVal, 'newVal')
            if(newVal == true){
                this.editVisible = true
                this.showDialog = true
            }
        },
        editVisible: function(newVal) {
            this.$emit('close', {
                showDialog: newVal
            })
        }
    },
    computed: {
        aNum () {
            return 123
        }
    },
    created () {

    }

}
</script>

<style scoped>

</style>